<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Artist</title>
    </head>
    <body>
        <div>
            <g:link action="edit" id="${artistInstance.id}">Edit</g:link>
            <g:link action="delete" id="${artistInstance.id}" onclick="return confirm('Are you sure?');">Delete</g:link>
            <g:link controller="song" action="create" params="[artistId:artistInstance.id]">New Song</g:link>
        </div>
        <div>
            <g:if test="${flash.message}">
              <div class="message">${flash.message}</div>
            </g:if>

            <h1>Artist: ${fieldValue(bean:artistInstance, field:'name')}</h1>

            <h2>Songs</h2>
            <table>
              <tr><th>Title</th></tr>
              <g:each var="s" in="${artistInstance.songs}" status="i">
                <tr class="${(i % 2) == 0 ? 'dataTableRow1' : 'dataTableRow2'}">
                  <td><g:link controller="song" action="show" params="[artistId:artistInstance.id, id:s.id]">${s.title}</g:link></td>
                </tr>
              </g:each>
            </table>

        </div>
    </body>
</html>
